<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let a = new Array(3);
      let b = [undefined, undefined, undefined];
      let c = [];
      c.length = 3;
      // a c中的长度是3 但是实际是没有值得  而b中长度为3 每一个都有值
      console.log(a, b, c);
      // 所以a c遍历的时候是没办法进行遍历的 b是可以进行正常遍历
      a.map((val) => {
        console.log(val);
      });
      b.map((val) => {
        console.log(val);
      });
      console.log(a.join("-"));
    </script>
  </body>
</html>
